﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
    Inherits="BitlockerRecovery.SelfService" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceholder1" runat="server">
    <asp:TextBox ID="Dummy" Visible="true" runat="server" Height="0" Width="0" BorderStyle="None"
        BorderWidth="0"></asp:TextBox><br />
    <asp:MultiView runat="server" ActiveViewIndex="0" ID="SelfServiceMultiview">
        <asp:View ID="SearchView" runat="server">
            <asp:Label ID="InfoRecoveryIDText" CssClass="InfoLabel" runat="server">Please enter the first eight(8) characters of the Recovery Key ID.</asp:Label><br /><br />
            <asp:TextBox CssClass="InputTextBox" ID="RecoveryGUID" runat="server" MaxLength="8"></asp:TextBox>
            <asp:Button ID="SubmitButton" CssClass="SubmitButton" ValidationGroup="UserSearch" OnClick="Submit_Click"
                Text="Submit" runat="server" />
            <br />
            <asp:RegularExpressionValidator ID="RegexValidGUID" runat="server" ControlToValidate="RecoveryGUID"
                SetFocusOnError="true" ErrorMessage="Invalid Input: RecoveryGUID." ValidationExpression="^[a-zA-Z0-9]{8,}$"
                Display="None" ValidationGroup="UserSearch"></asp:RegularExpressionValidator>
            <asp:RequiredFieldValidator ID="RequiredGUID" runat="server" ControlToValidate="RecoveryGUID"
                SetFocusOnError="true" ErrorMessage="Recovery GUID is a required field" Display="None"
                ValidationGroup="UserSearch"></asp:RequiredFieldValidator>
            <asp:ValidationSummary runat="server" HeaderText="Please correct the following:"
                ShowMessageBox="true" ID="AllValidations" ShowSummary="false" DisplayMode="BulletList"
                ValidationGroup="UserSearch" />
        </asp:View>
        <asp:View ID="ResultsView" runat="server">
            <table>
                 <tr>
                    <td>
                        <asp:Label CssClass="InfoLabel" runat="server" Font-Bold="true">Machine Name:</asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="MachineNameLabel" CssClass="DisplayData" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="MachineOwnerLabel" CssClass="InfoLabel" runat="server" Font-Bold="true">Machine Owner:</asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="UserLabel" CssClass="DisplayData" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label3" CssClass="InfoLabel" runat="server" Font-Bold="true">Full Recovery Key ID:</asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="RecoveryGUIDLabel" CssClass="DisplayData" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label4" CssClass="InfoLabel" runat="server" Font-Bold="true">Recovery Key Password:</asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="RecoveryPasswordLabel" CssClass="DisplayData" runat="server" ForeColor="Red"
                            Font-Bold="true"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <font color="red" style="font-weight: bold">NOTE: </font>This is the recovery information
                        you need to complete the Bitlocker recovery process. Enter this complete key when
                        asked by Bitlocker for your recovery password.
                    </td>
                </tr>
            </table>
            <br />
            <br />
            <hr width="100%" />
            <br />
            <asp:Label ID="OptionalLabel" CssClass="InfoLabel" runat="server" Font-Bold="true">
                Optional Bitlocker Recovery Components. For Advanced Users Only.</asp:Label>
            <br />
            <br />
            <table>
                <tr>
                    <td>
                        <asp:Label ID="Label5" CssClass="InfoLabel" runat="server" Font-Bold="true">Recovery Key Package:</asp:Label>
                    </td>
                    <td>
                        <asp:Button Width="250px" ID="Button3" Text="Download Key Package file" runat="server" OnClick="DownloadKeyPackage_OnClick" />
                        <asp:TextBox ID="HdKeyPackage" runat="server" Visible="false" Enabled="false" ReadOnly="true"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label6" CssClass="InfoLabel" runat="server" Font-Bold="true">TPM Hash File:</asp:Label>
                    </td>
                    <td>
                        <asp:Button Width="250px" ID="TPMHashButton" Text="Download TPM Hash file" runat="server" OnClick="DownloadTPM_OnClick" />
                        <asp:TextBox ID="hdTPMHash" runat="server" Visible="false" Enabled="false" ReadOnly="true"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td colspan="2" align="right">
                        <asp:Button Text="Back" runat="server" OnClick="Back_OnClick" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Label CssClass="InfoLabel" runat="server">For more information on how to use this data, please see the <a href="Faq.aspx">Faq</a>.</asp:Label>
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    <asp:Label ID="LabelMessage" runat="server"></asp:Label>
</asp:Content>
